<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>添加收获地址</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script type="text/javascript">
	function abc() {
		var x = document.getElementById("main_middle_right");
		if (x.style.display == "none") {
			x.style.display = "block";
		} else {
			x.style.display = "none";
		}
	}

	//手机号码的验证（13开头18开头和158，159开头，共11位
	function validate() {
		re = /^(13[0-9]{9})| (18[0-9]{9}) |(15[289][0-9]{8})$/;
		if (!re.test(document.myform.phone.value)) {
			alert("电话号码格式错误.");
			document.myform.phone.focus();
			return false;
		}
		// 邮政编码的验证（开头不能为0，共6位）
		re = /^[1-9][0-9]{5}$/;
		if (!re.test(document.myform.postCode.value)) {
			alert("邮编格式错误.");
			document.myform.postCode.focus();
			return false;
		}
		return true;
	}
</script>
<style>
#content {
	border: 1px solid #e6e6e6;
	height: 310px;
	width: 90%;
	margin-left: px;
}

#main_middle_right{
margin-left:10px;
}
</style>
</head>
<body style="min-width: 980px;">
	<div id="main_top">
		<jsp:include page="headarea.jsp"></jsp:include>
	</div>
	<div class="header_wrape">
		<div class="navwrape">
			<div id="nave">
				<div class="navbare clearfix">
					<a class="currente" href="menu_listservlet">首页</a> <a
						href="Close_List">衣服</a> <a href="Shose_List"">鞋靴</a> <a
						href="Pant_List">裤子</a>
				</div>
			</div>
		</div>
	</div>
	<div class="block box">
		<div class="blank"></div>
		<div id="ur_here">
			当前位置: <a href="menu_listservlet">首页</a>
			<code>&gt;</code>
			收获地址
		</div>
	</div>
	<div id="content">
		<h3 style="width: 97.2%">
			<span>请确认以下信息，然后提交订单</span>
		</h3>
		<div>
			<h2 style="font-size: 14px; background: #00CC66;">
				收货人信息 <a style="float: right;" href="ListReceving">收货地址管理</a>
			</h2>
			<!--{填写收货地址 start}-->
			<!-- 显示默认的地址 -->
			<div class="hidden-div"
				style="border: 1px solid #e6e6e6; height: 57px">
				<a id="toggle" onclick="abc()" style="font-size: 14px; cursor: pointer">修改收获地址</a> 
			    <br /><br/>
				<c:forEach items="${list }" var="list">
					<ul style="height: 400px; line-height: 0px;">
						<li class="li">
						     <input type="radio" class="radio" checked="checked"> 
						        <label> ${list.rName }&nbsp;&nbsp;&nbsp;${list.rReceivingaddress }&nbsp;&nbsp;&nbsp;${list.rPostCard}(收)
								&nbsp;&nbsp;&nbsp;${list.rPhone } 
							    </label>
					      </li>
						<!-- 不使用默认，用户重新写一个收货地址 -->
						<li>
							<div style="display:none;height: 300px;" id="main_middle_right" >
								<form action="eidtnewaddress" method="get" name="myform" onSubmit="return validate()">
									<input type="hidden" name="rId" value="${list.rId }">
									<input type="hidden" name="curpage" value="${param.curpage }">
									<input type="hidden" name="cId" value="${param.cId }">
									<input type="hidden" name="cName" value="${param.cName }">
									<input type="hidden" name="dPrice" value="${param.dPrice }">
									<input type="hidden" name="count" value="${param.count }">
									<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
										<tr>
											<td align="right" bgcolor="#ffffff" style="font-size: 14px">详细地址：</td>
											<td align="left" bgcolor="#ffffff">
											       <input name="rReceivingaddress" type="text" class="inputBg" value="${list.rReceivingaddress }" />
											</td>
											<td align="right" bgcolor="#ffffff" style="font-size: 14px">收货人姓名：</td>
											<td align="left" bgcolor="#ffffff">
											    <input name="rName" type="text" class="inputBg" value="${list.rName}" />
										    </td>
										</tr>
										<tr>
											<td align="right" bgcolor="#ffffff" style="font-size: 14px">邮政编码：</td>
											<td align="left" bgcolor="#ffffff">
											      <input name="rPostCard" type="text" class="inputBg"  value="${list.rPostCard }" />
											</td>
											<td align="right" bgcolor="#ffffff" style="font-size: 14px">手机号码：</td>
											<td align="left" bgcolor="#ffffff">
											     <input name="rPhone" type="text" class="inputBg" value="${list.rPhone  }" /></td>
										</tr>
										<tr>
											<td align="right" bgcolor="#ffffff" style="font-size: 14px">电子邮箱地址：</td>
											<td align="left" bgcolor="#ffffff">
											      <input name="email" type="text" class="inputBg" value="" />(省略)</td>
											<td align="right" bgcolor="#ffffff" style="font-size: 14px">qq：</td>
											<td align="left" bgcolor="#ffffff" width="14%">
											   <input name="mobile" type="text" class="inputBg" value="" /></td>
										</tr>
										<tr>
											<td align="right" bgcolor="#ffffff">&nbsp;</td>
											<td colspan="3" align="center" bgcolor="#ffffff">
											  <input class="btn" type="submit" value="提交" /> 
											  <input class="btn" type="reset" value="重置" /></td>
										</tr>
									</table>
								</form>
							</div>
						</li>
					</ul>
				</c:forEach>
			</div>
		</div>
	</div>
	<div class="blank"></div>
	<div id="end_div" style="margin-top: 10px;">
		<jsp:include page="end.jsp"></jsp:include>
	</div>
</body>
</html>